import request from '@/utils/request'

export function login(data) {
  return request({
    url: 'api/app/smart-hotel-app-user/login',
    method: 'post',
    data
  })
}

export function logout() {
  return request({
    url: '/vue-element-admin/user/logout',
    method: 'post'
  })
}
export function getInfo(page) {
  return request({
    url: '/api/app/smart-hotel-app-user/hash-code',
    method: 'get',
    params: {
      pageIndex: page.pageIndex,
      pageSize: page.pageSize,
      userName: page.userName,
    }
  })
}

export function deluser(id) {
  return request({
    url: '/api/app/smart-hotel-app-user/' + id + '/user',
    method: 'delete',
  })
}
export function Registers(data) {
  return request({
    method: "post",
    url: "/api/app/smart-hotel-app-user",
    data: data
  })
}

export function getid(id) {
  return request({
    url: '/api/app/smart-hotel-app-user/' + id + '/find-user',
    method: 'get',
    id: id
  })
}

export function update(data) {
  return request({
    url: '/api/app/smart-hotel-app-user/user',
    method: 'put',
    data: dtaa
  })
}
export function roleList() {
  return request({
    url: '/api/app/smart-hotel-app-role/role',
    method: 'get',
  })
}

export function setUpRole(data) {
  return request({
    method: "post",
    url: "/api/app/smart-hotel-app-user-role/user-role",
    data: data
  })
}
